// pages/caicaicai/index.js
let usernumber;
let computernnumber;
Page({
data:{
  foc:true,
  //list:[]
},

  
  onLoad(options) {
    computernnumber=parseInt(Math.random()*100);
   console.log("计算机的名称",computernnumber);
},
  inputData(e){
    usernumber= parseInt(e.detail.value);
  },
 caicaicai(e){
   var list=this.data.list;
   
  if(list==null){ list=[]}
  list.push(usernumber);
   if(list.length>5) {list.shift()}
   var mess=null;
   
     if (usernumber==computernnumber){
     mess="恭喜你，猜对了!";
      }else if(usernumber<computernnumber){
     mess="sorry,猜小了~";
      }else {
       mess="sorry,猜大了~";
    }
  this.setData({result:mess ,value:"" ,foc:true,list,});
 }

})